﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Cosmetic.Logic;

namespace WebApp.Controls
{
	public partial class ShoppingBasket : System.Web.UI.UserControl
	{
        ProductManager m_ProductManager = new ProductManager();
		private Guid m_UserId;
		public Guid UserId 
		{
			get
			{
				return this.m_UserId;
			}
			set
			{
				this.m_UserId	= value;
				this.Bind();
			}
		}

		protected void Page_Load(object sender, EventArgs e)
		{
			this.Bind();
		}

		public void Refresh()
		{
			this.Bind();
		}

		private void Bind()
		{
			if (null != this.UserId && Guid.Empty != this.UserId)
			{
				//UserManager theUserManger	= new UserManager();
                this.lvProduct.DataSource = m_ProductManager.GetFavoriteProductInfo(this.UserId);//.GetFavoriteByUser(this.UserId, false);
				this.lvProduct.DataBind();
			}
		}
	}
}